<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    * {
      padding: 0;
      margin: 0;
    }

    .cls {
      width: 300px;
      height: 200px;
      border: 2px solid red;
    }
  </style>
</head>

<body>
  <div id="app">
    <hell-word></hell-word>
    <!-- 
      组件使用的方式
        使用大驼峰命名的组件，只能在模板字符串中使用组件。调用组件是必须要“短杆”
        不推荐使用大驼峰命令组件
     -->
  </div>
  <script src="../js/vue.js"></script>
  <script>
    Vue.component("HellWord", {
      data() {
        return {
          "count": 0
        }
      },
      "methods": {
        add() {
          this.count++;
        }
      },
      "template": `<div class="cls"><button @click="add">{{count}}</button></div>`
    });
    const vm = new Vue({
      "el": "#app",
      "data": {},
      mounted() {},
      updated() {},
      "methods": {},
      "directives": {},
      "computed": {},
      "watch": {},
      "filters": {}
    });
  </script>
</body>

</html>